package com.gewu.pm.ui.adapter.work;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gewu.pm.R;
import com.gewu.pm.app.AppAdapter;
import com.gewu.pm.bean.ManagementBean;
import com.hjq.base.BaseAdapter;

/**
 * 促销拜访 适配器
 */
public class PromotionVisitAdapter extends AppAdapter<ManagementBean> {

    public PromotionVisitAdapter(@NonNull Context context) {
        super(context);
    }

    @NonNull
    @Override
    public BaseAdapter<?>.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new PromotionVisitViewHolder();
    }

    private final class PromotionVisitViewHolder extends AppAdapter<?>.ViewHolder {

        private final TextView mTitleView;

        private PromotionVisitViewHolder() {
            super(R.layout.promotion_visit_item);
            mTitleView = findViewById(R.id.tv_title);
        }

        @Override
        public void onBindView(int position) {
            ManagementBean item = getItem(position);
            mTitleView.setText(item.getName());
        }
    }
}
